package com.qian.Test;

import com.qian.Test.Manag;
import com.qian.Test.Student;

import java.util.ArrayList;
import java.util.Scanner;

public class TestDemo {
    public static void test01() {
        Scanner sc = new Scanner(System.in);
        //创建arrayList容器
        ArrayList<Student> list = new ArrayList<>();
        Student s = new Student(9,"小王",22,"上海");
        list.add(s);

        while(true){
            String n;

            Manag.homepage(); //主页
            n = sc.next();

            switch (n){
                case "1":
                    //添加
                    Manag.addObject(list);
                    break;
                case "2":
                    //删除
                    Manag.deleteObject(list);
                    break;
                case "3":
                    //修改
                    Manag.revampObject(list);
                    break;
                case "4":
                    //查询
                    Manag.lookObject(list);
                    break;
                case "5":
                    //退出
                    System.out.println("退出程序！");
                    return;
                default:
                    System.out.println("输入错误！");
                    break;
            }
        }
    }
}
